home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Frameworks
/
Grant's CGI Framework 1.0b14
/
Util
/
ProcessUtil.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-11
|
2KB
|
84 lines
#pragma once
/*****
*
* ProcessUtil.h
*
* This is a support file for "Grant's CGI Framework".
* Please see the license agreement that accompanies the distribution package
* for licensing details.
*
* Copyright ©1995,1996 by Grant Neufeld
* grant@acm.org grant@kagi.com
* http://arpp.carleton.ca/grant/
*
*****/
#include <Threads.h>
#include "MyConfiguration.h"
/*** CONSTANTS ***/
#define kProcessNoTimeout nil
/*** FUNCTION PROTOTYPES ***/
void ProcessStartup ( void );
p_export void ProcessGiveTime ( UInt32 );
Boolean ProcessCurrentIsFront ( void );
Boolean ProcessWaitUntilFront ( unsigned long );
Boolean ProcessIsFront ( ProcessSerialNumber * );
OSErr ProcessGetMyFSSpec ( FSSpec * );
p_export void ProcessIsMoreBusy ( void );
p_export void ProcessIsLessBusy ( void );
p_export void ProcessSleepSetDefault ( UInt32 );
p_export void ProcessSleepSetBusy ( UInt32 );
p_export void ProcessSleepDefault ( void );
p_export void ProcessSleepBusy ( void );
void ThreadStartup ( void );
p_export OSErr ThreadYield ( ThreadID, Boolean );
#if kStartupThreadsPreallocate > nil
p_export OSErr ThreadNewThreadFromPool ( ThreadEntryProcPtr, void *, void **, ThreadID * );
void ThreadFinishAllSubThreads ( void );
p_export OSErr ThreadSleep ( ThreadID );
p_export OSErr ThreadWakeNext ( void );
void ThreadWakeAll ( ThreadID );
#endif
#define ProcessIsBackgroundOnly (!(kCompileWithForeground))
#if !(kCompileWithout_MY_Names)
#define MyNewThreadFromPool ThreadNewThreadFromPool
#endif
/*** EXTERNAL FUNCTION PROTOTYPES ***/
/* this function will be called periodically from the deferred tasks
thread when the application is not busy, (or at idle time if the
thread can't be created).
It should not use much time since events may come in while it is
processing. This can be otherwise if you require the Thread Manager
and use 'ProcessGiveTime' frequently.
Note that it is possible for the deferred task thread to not be
called at all if the application is continually busy (IE. new CGI
events come in before old ones are finished so that there is no
non-busy time). This is highly unlikely, but should be taken into
account. I may provide a 'timer' mechanism in the future whereby
you could set a time by which the deferred task must be called,
even if the application is busy. */
#if kCompileWithDeferredTask
p_export void CustomDeferredTask ( void );
#endif
/***** EOF *****/